Validating user input is a common circumstance in a Web-based application. A Web page typically accepts user input through an on-screen control, such as a text box or a list box. It is often desirable for the input data to be “validated” before being transmitted to a back-end server-side process, such as back-end database application. Validation, for example, may include verifying that a required field is populated or that a proper data format is used in an input control (e.g., a date format).
One existing approach to validation involves sending the input data in an HTTP (“Hyper Text Transfer Protocol”) request to the server, where server-side, developer-provided validation program code (e.g., a developed-provided validation routine in a server-side Web application) validates the input data. If an error is detected, the validation program code indicates an error condition to the client in an HTTP response. In no error is detected, the input data may be submitted to the back-end server-side process.
A second approach involves client-side, developer-provided validation program code (e.g., a client-side script) that is transmitted to the client with the web page. If an error is detected by the client-side validation program code, an error is displayed to the user and the input data is not sent to the server. If no error is detected, the input data is sent to the server in an HTTP request for processing.
These approaches, however, require a developer to provide custom validation code, which requires a sophisticated understanding of client-side and/or server-side programming. Many web page authors, as distinguished from web developers, lack the programming knowledge required to provide adequate validation of input data. Moreover, server side application developers often lack an intimate understanding of client-side scripting and authoring languages (e.g., HTML).
In addition, it is often desirable to provide both client-side and server-side validation. Client-side validation gives rapid feedback to a user, by avoiding a round-trip to the server. The validation occurs within the browser on the client before submission of an HTTP request to the server. DHTML (“Dynamic Hyper Text Markup Language”) and scripting languages provide improved capabilities of client-side validation over standard HTML (Hyper Text Markup Language); however, more sophisticated coding is often required. In addition, once input data is validated on the client, a web application must still re-validate the information on the server to capture intentionally or inadvertently corrupted input data received from clients (e.g., such as clients that lack a required client-scripting environment). Therefore, much of the client-side validation logic must still be duplicated on the server.